/*
 * @Author: cmd 
 * @wechat: cmd_develop 
 *  @Date: 2019-11-07 15:50:06 
 * @Last Modified by: cmd
 * @Last Modified time: 2019-11-08 13:35:38
 * @Description: 
 */

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property(cc.Node)
    bg_node:cc.Node = null;

    @property(cc.Node)
    player_node:cc.Node = null;a
    

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        console.log('game_scene onload');
        cc.director.getCollisionManager().enabled = true;        
    }

    start () {

    }

    btn_test(){
        console.log('btn_test');
        // this.node.dispatchEvent( new cc.Event.EventCustom('bg_roll',true) );
        
        this.bg_node.emit('bg_roll',false);
    }

    btn_game_add(){
        console.log('btn_game_add');
        this.player_node.emit('body_add');
    }

    btn_game_minus(){
        console.log('btn_game_minus');
        this.player_node.emit('body_minus');
    }

    // update (dt) {}
}
